import { log } from 'video.js'
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'main',
        component: () =>
            import ('../views/Main.vue'),
        children: [{
                path: 'movieCinema',
                alias: '',
                name: 'MovieCinema',
                component: () =>
                    import ('../views/MovieCinema.vue'),
                redirect: '/movieCinema/wellrece',
                children: [{
                        path: 'wellrece',
                        name: 'Wellrece',
                        component: () =>
                            import ('../views/Wellrece.vue')
                    },
                    {
                        path: 'cinema',
                        name: 'Cinema',
                        // alias: '',
                        component: () =>
                            import ('../views/Cinema.vue')
                    },
                    {
                        path: 'tobeshown',
                        name: 'Tobeshown',
                        component: () =>
                            import ('../views/Tobeshown.vue')
                    },
                    {
                        path: 'classicFilms',
                        name: 'ClassicFilms',
                        component: () =>
                            import ('../views/ClassicFilms.vue')
                    },
                ]
            },
            {
                path: 'shipin',
                name: 'Shipin',
                component: () =>
                    import ('../views/Shipin.vue'),

            },
            {
                path: 'smallVideo',
                name: 'SmallVideo',
                component: () =>
                    import ('../views/SmallVideo.vue')
            },
            {
                path: 'my',
                name: 'My',
                component: () =>
                    import ('../views/My.vue'),
                meta: {
                    // auth为true，表示该路由是需要登录才能访问的
                    auth: true
                        // isLogin: false
                }
            },
        ]
    },
    {
        path: '/citylist',
        name: 'Citylist',
        component: () =>
            import ('../views/Citylist.vue')
    },
    {
        path: '/movieDetail/:movieId',
        name: 'MovieDetail',
        component: () =>
            import ('../views/MovieDetail.vue')
    },
    {
        path: '/login',
        name: 'Login',
        component: () =>
            import ('../views/Login.vue')
    },
    {
        path: '/register',
        name: 'Register',
        component: () =>
            import ('../views/Register.vue')
    },
    {
        path: '/cinemaDetail/:cinemaId',
        name: 'CinemaDetail',
        component: () =>
            import ('../views/CinemaDetail.vue')
    },
    {
        path: '/search',
        name: 'Search',
        component: () =>
            import ('../views/Search.vue')
    },
    {
        path: '/watchVideo',
        name: 'WatchVideo',
        component: () =>
            import ('../views/WatchVideo.vue')
    },
    {
        path: '/moreCinemaDetail/:cinemaId',
        name: 'MoreCinemaDetail',
        component: () =>
            import ('../views/MoreCinemaDetail.vue')
    },
    {
        path: '/selectSeat',
        name: 'SelectSeat',
        component: () =>
            import ('../views/SelectSeat.vue')
    },
]


const router = new VueRouter({
    mode: 'hash',
    routes
})

export default router